﻿Imports System.Data
Imports System.Data.OleDb
Imports geraLaudosAutomatico.conexao
Imports System.Text
Public Class modificacao_coordenacaoDAO


    Dim sql As New StringBuilder
    Dim objConn As New conexao
    Dim i As Integer
    Dim modificacao_coordenacao As modificacao_coordenacaoVO

    Public Function getModificaoCoordenacoes() As Generic.List(Of modificacao_coordenacaoVO)

        sql.Clear()
        sql.Append("SELECT * FROM MODIFICACAO_COORDENACAO ORDER BY ID_MODIFICACAO")

        Dim oReader As OleDbDataReader
        Dim lista As New Generic.List(Of modificacao_coordenacaoVO)

        Try
            Dim oComando As New OleDbCommand(sql.ToString, objConn.abreConexao)

            oReader = oComando.ExecuteReader

            While oReader.Read

                modificacao_coordenacao = New modificacao_coordenacaoVO
                modificacao_coordenacao.ID_MODIFICACAO = oReader("ID_MODIFICACAO")
                modificacao_coordenacao.TABELA = oReader("TABELA")
                modificacao_coordenacao.DATA_MODIFICACAO = oReader("DATA_MODIFICACAO")
                lista.Add(modificacao_coordenacao)


            End While

            Return lista

        Catch ex As Exception

            Throw ex

        Finally

            objConn.fechaConexao()

        End Try

    End Function



    Public Function getModificaoCoordenacao(ByVal id_modificacao As Integer) As modificacao_coordenacaoVO

        sql.Clear()
        sql.Append("SELECT * FROM MODIFICACAO_COORDENACAO")
        sql.Append(" WHERE ID_MODIFICACAO=" & id_modificacao)
        sql.Append(" ORDER BY ID_MODIFICACAO")

        Dim oReader As OleDbDataReader
        Dim lista As New Generic.List(Of modificacao_coordenacaoVO)

        Try
            Dim oComando As New OleDbCommand(sql.ToString, objConn.abreConexao)

            oReader = oComando.ExecuteReader

            While oReader.Read

                modificacao_coordenacao = New modificacao_coordenacaoVO
                modificacao_coordenacao.ID_MODIFICACAO = oReader("ID_MODIFICACAO")
                modificacao_coordenacao.TABELA = oReader("TABELA")
                modificacao_coordenacao.DATA_MODIFICACAO = oReader("DATA_MODIFICACAO")
            End While

            Return modificacao_coordenacao

        Catch ex As Exception

            Throw ex

        Finally

            objConn.fechaConexao()

        End Try

    End Function

End Class
